\(\int (a+a \sec (e+f x))^{3/2} (c-c \sec (e+f x)) \, dx\) [52]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 26, antiderivative size = 101 \[ \int (a+a \sec (e+f x))^{3/2} (c-c \sec (e+f x)) \, dx=\frac {2 a^{3/2} c \arctan \left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f}-\frac {2 a^2 c \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}}-\frac {2 a^3 c \tan ^3(e+f x)}{3 f (a+a \sec (e+f x))^{3/2}} \]

[Out]

2*a^(3/2)*c*arctan(a^(1/2)*tan(f*x+e)/(a+a*sec(f*x+e))^(1/2))/f-2*a^2*c*tan(f*x+e)/f/(a+a*sec(f*x+e))^(1/2)-2/
3*a^3*c*tan(f*x+e)^3/f/(a+a*sec(f*x+e))^(3/2)

Rubi [A] (verified)

Time = 0.16 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.192, Rules used = {3989, 3972, 470, 327, 209} \[ \int (a+a \sec (e+f x))^{3/2} (c-c \sec (e+f x)) \, dx=\frac {2 a^{3/2} c \arctan \left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a \sec (e+f x)+a}}\right )}{f}-\frac {2 a^3 c \tan ^3(e+f x)}{3 f (a \sec (e+f x)+a)^{3/2}}-\frac {2 a^2 c \tan (e+f x)}{f \sqrt {a \sec (e+f x)+a}} \]

[In]

Int[(a + a*Sec[e + f*x])^(3/2)*(c - c*Sec[e + f*x]),x]

[Out]

(2*a^(3/2)*c*ArcTan[(Sqrt[a]*Tan[e + f*x])/Sqrt[a + a*Sec[e + f*x]]])/f - (2*a^2*c*Tan[e + f*x])/(f*Sqrt[a + a
*Sec[e + f*x]]) - (2*a^3*c*Tan[e + f*x]^3)/(3*f*(a + a*Sec[e + f*x])^(3/2))

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 327

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^n
)^(p + 1)/(b*(m + n*p + 1))), x] - Dist[a*c^n*((m - n + 1)/(b*(m + n*p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 470

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[d*(e*x)^(m +
 1)*((a + b*x^n)^(p + 1)/(b*e*(m + n*(p + 1) + 1))), x] - Dist[(a*d*(m + 1) - b*c*(m + n*(p + 1) + 1))/(b*(m +
 n*(p + 1) + 1)), Int[(e*x)^m*(a + b*x^n)^p, x], x] /; FreeQ[{a, b, c, d, e, m, n, p}, x] && NeQ[b*c - a*d, 0]
 && NeQ[m + n*(p + 1) + 1, 0]

Rule 3972

Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_.), x_Symbol] :> Dist[-2*(a^(m/2 +
 n + 1/2)/d), Subst[Int[x^m*((2 + a*x^2)^(m/2 + n - 1/2)/(1 + a*x^2)), x], x, Cot[c + d*x]/Sqrt[a + b*Csc[c +
d*x]]], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0] && IntegerQ[m/2] && IntegerQ[n - 1/2]

Rule 3989

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.)*(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))^(n_.), x_Symbol] :> Di
st[((-a)*c)^m, Int[Cot[e + f*x]^(2*m)*(c + d*Csc[e + f*x])^(n - m), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x]
&& EqQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0] && IntegerQ[m] && RationalQ[n] &&  !(IntegerQ[n] && GtQ[m - n, 0])

Rubi steps \begin{align*} \text {integral}& = -\left ((a c) \int \sqrt {a+a \sec (e+f x)} \tan ^2(e+f x) \, dx\right ) \\ & = \frac {\left (2 a^3 c\right ) \text {Subst}\left (\int \frac {x^2 \left (2+a x^2\right )}{1+a x^2} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f} \\ & = -\frac {2 a^3 c \tan ^3(e+f x)}{3 f (a+a \sec (e+f x))^{3/2}}+\frac {\left (2 a^3 c\right ) \text {Subst}\left (\int \frac {x^2}{1+a x^2} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f} \\ & = -\frac {2 a^2 c \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}}-\frac {2 a^3 c \tan ^3(e+f x)}{3 f (a+a \sec (e+f x))^{3/2}}-\frac {\left (2 a^2 c\right ) \text {Subst}\left (\int \frac {1}{1+a x^2} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f} \\ & = \frac {2 a^{3/2} c \arctan \left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f}-\frac {2 a^2 c \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}}-\frac {2 a^3 c \tan ^3(e+f x)}{3 f (a+a \sec (e+f x))^{3/2}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.59 (sec) , antiderivative size = 100, normalized size of antiderivative = 0.99 \[ \int (a+a \sec (e+f x))^{3/2} (c-c \sec (e+f x)) \, dx=-\frac {2 a^2 c \left (-3 \sqrt {c} \text {arctanh}\left (\frac {\sqrt {c-c \sec (e+f x)}}{\sqrt {c}}\right )+(2+\sec (e+f x)) \sqrt {c-c \sec (e+f x)}\right ) \tan (e+f x)}{3 f \sqrt {a (1+\sec (e+f x))} \sqrt {c-c \sec (e+f x)}} \]

[In]

Integrate[(a + a*Sec[e + f*x])^(3/2)*(c - c*Sec[e + f*x]),x]

[Out]

(-2*a^2*c*(-3*Sqrt[c]*ArcTanh[Sqrt[c - c*Sec[e + f*x]]/Sqrt[c]] + (2 + Sec[e + f*x])*Sqrt[c - c*Sec[e + f*x]])
*Tan[e + f*x])/(3*f*Sqrt[a*(1 + Sec[e + f*x])]*Sqrt[c - c*Sec[e + f*x]])

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(205\) vs. \(2(89)=178\).

Time = 1.11 (sec) , antiderivative size = 206, normalized size of antiderivative = 2.04

method result size
default \(\frac {2 c a \sqrt {a \left (\sec \left (f x +e \right )+1\right )}\, \left (\operatorname {arctanh}\left (\frac {\sin \left (f x +e \right )}{\left (\cos \left (f x +e \right )+1\right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}}\right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \cos \left (f x +e \right )+\operatorname {arctanh}\left (\frac {\sin \left (f x +e \right )}{\left (\cos \left (f x +e \right )+1\right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}}\right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}+\sin \left (f x +e \right )\right )}{f \left (\cos \left (f x +e \right )+1\right )}-\frac {2 c a \sqrt {a \left (\sec \left (f x +e \right )+1\right )}\, \left (5 \sin \left (f x +e \right )+\tan \left (f x +e \right )\right )}{3 f \left (\cos \left (f x +e \right )+1\right )}\) \(206\)
parts \(\frac {2 c a \sqrt {a \left (\sec \left (f x +e \right )+1\right )}\, \left (\operatorname {arctanh}\left (\frac {\sin \left (f x +e \right )}{\left (\cos \left (f x +e \right )+1\right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}}\right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \cos \left (f x +e \right )+\operatorname {arctanh}\left (\frac {\sin \left (f x +e \right )}{\left (\cos \left (f x +e \right )+1\right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}}\right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}+\sin \left (f x +e \right )\right )}{f \left (\cos \left (f x +e \right )+1\right )}-\frac {2 c a \sqrt {a \left (\sec \left (f x +e \right )+1\right )}\, \left (5 \sin \left (f x +e \right )+\tan \left (f x +e \right )\right )}{3 f \left (\cos \left (f x +e \right )+1\right )}\) \(206\)

[In]

int((a+a*sec(f*x+e))^(3/2)*(c-c*sec(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

2*c/f*a*(a*(sec(f*x+e)+1))^(1/2)*(arctanh(sin(f*x+e)/(cos(f*x+e)+1)/(-cos(f*x+e)/(cos(f*x+e)+1))^(1/2))*(-cos(
f*x+e)/(cos(f*x+e)+1))^(1/2)*cos(f*x+e)+arctanh(sin(f*x+e)/(cos(f*x+e)+1)/(-cos(f*x+e)/(cos(f*x+e)+1))^(1/2))*
(-cos(f*x+e)/(cos(f*x+e)+1))^(1/2)+sin(f*x+e))/(cos(f*x+e)+1)-2/3*c/f*a*(a*(sec(f*x+e)+1))^(1/2)/(cos(f*x+e)+1
)*(5*sin(f*x+e)+tan(f*x+e))

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 303, normalized size of antiderivative = 3.00 \[ \int (a+a \sec (e+f x))^{3/2} (c-c \sec (e+f x)) \, dx=\left [\frac {3 \, {\left (a c \cos \left (f x + e\right )^{2} + a c \cos \left (f x + e\right )\right )} \sqrt {-a} \log \left (\frac {2 \, a \cos \left (f x + e\right )^{2} - 2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + a \cos \left (f x + e\right ) - a}{\cos \left (f x + e\right ) + 1}\right ) - 2 \, {\left (2 \, a c \cos \left (f x + e\right ) + a c\right )} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sin \left (f x + e\right )}{3 \, {\left (f \cos \left (f x + e\right )^{2} + f \cos \left (f x + e\right )\right )}}, -\frac {2 \, {\left (3 \, {\left (a c \cos \left (f x + e\right )^{2} + a c \cos \left (f x + e\right )\right )} \sqrt {a} \arctan \left (\frac {\sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{\sqrt {a} \sin \left (f x + e\right )}\right ) + {\left (2 \, a c \cos \left (f x + e\right ) + a c\right )} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sin \left (f x + e\right )\right )}}{3 \, {\left (f \cos \left (f x + e\right )^{2} + f \cos \left (f x + e\right )\right )}}\right ] \]

[In]

integrate((a+a*sec(f*x+e))^(3/2)*(c-c*sec(f*x+e)),x, algorithm="fricas")

[Out]

[1/3*(3*(a*c*cos(f*x + e)^2 + a*c*cos(f*x + e))*sqrt(-a)*log((2*a*cos(f*x + e)^2 - 2*sqrt(-a)*sqrt((a*cos(f*x
+ e) + a)/cos(f*x + e))*cos(f*x + e)*sin(f*x + e) + a*cos(f*x + e) - a)/(cos(f*x + e) + 1)) - 2*(2*a*c*cos(f*x
 + e) + a*c)*sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*sin(f*x + e))/(f*cos(f*x + e)^2 + f*cos(f*x + e)), -2/3*(
3*(a*c*cos(f*x + e)^2 + a*c*cos(f*x + e))*sqrt(a)*arctan(sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*cos(f*x + e)/
(sqrt(a)*sin(f*x + e))) + (2*a*c*cos(f*x + e) + a*c)*sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*sin(f*x + e))/(f*
cos(f*x + e)^2 + f*cos(f*x + e))]

Sympy [F]

\[ \int (a+a \sec (e+f x))^{3/2} (c-c \sec (e+f x)) \, dx=- c \left (\int \left (- a \sqrt {a \sec {\left (e + f x \right )} + a}\right )\, dx + \int a \sqrt {a \sec {\left (e + f x \right )} + a} \sec ^{2}{\left (e + f x \right )}\, dx\right ) \]

[In]

integrate((a+a*sec(f*x+e))**(3/2)*(c-c*sec(f*x+e)),x)

[Out]

-c*(Integral(-a*sqrt(a*sec(e + f*x) + a), x) + Integral(a*sqrt(a*sec(e + f*x) + a)*sec(e + f*x)**2, x))

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 998 vs. \(2 (89) = 178\).

Time = 0.44 (sec) , antiderivative size = 998, normalized size of antiderivative = 9.88 \[ \int (a+a \sec (e+f x))^{3/2} (c-c \sec (e+f x)) \, dx=\text {Too large to display} \]

[In]

integrate((a+a*sec(f*x+e))^(3/2)*(c-c*sec(f*x+e)),x, algorithm="maxima")

[Out]

1/2*((a*arctan2((cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/4)*(cos(1/2*arctan2(sin(
2*f*x + 2*e), cos(2*f*x + 2*e)))*sin(1/2*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1)) - cos(1/2*arctan2(si
n(2*f*x + 2*e), cos(2*f*x + 2*e) + 1))*sin(1/2*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e)))), (cos(2*f*x + 2*e
)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/4)*(cos(1/2*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) +
 1))*cos(1/2*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e))) + sin(1/2*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e)
 + 1))*sin(1/2*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e)))) + 1) - a*arctan2((cos(2*f*x + 2*e)^2 + sin(2*f*x
+ 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/4)*(cos(1/2*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e)))*sin(1/2*arctan2
(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1)) - cos(1/2*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1))*sin(1/2*a
rctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e)))), (cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) +
1)^(1/4)*(cos(1/2*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1))*cos(1/2*arctan2(sin(2*f*x + 2*e), cos(2*f*x
 + 2*e))) + sin(1/2*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1))*sin(1/2*arctan2(sin(2*f*x + 2*e), cos(2*f
*x + 2*e)))) - 1) - a*arctan2((cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/4)*sin(1/2
*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1)), (cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*
e) + 1)^(1/4)*cos(1/2*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1)) + 1) + a*arctan2((cos(2*f*x + 2*e)^2 +
sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/4)*sin(1/2*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1)), (
cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/4)*cos(1/2*arctan2(sin(2*f*x + 2*e), cos(
2*f*x + 2*e) + 1)) - 1))*(cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/4)*sqrt(a) + 4*
(a*cos(1/2*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1))*sin(1/2*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e)
)) - (a*cos(1/2*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e))) - a)*sin(1/2*arctan2(sin(2*f*x + 2*e), cos(2*f*x
+ 2*e) + 1)))*sqrt(a))*c/((cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/4)*f)

Giac [F]

\[ \int (a+a \sec (e+f x))^{3/2} (c-c \sec (e+f x)) \, dx=\int { -{\left (a \sec \left (f x + e\right ) + a\right )}^{\frac {3}{2}} {\left (c \sec \left (f x + e\right ) - c\right )} \,d x } \]

[In]

integrate((a+a*sec(f*x+e))^(3/2)*(c-c*sec(f*x+e)),x, algorithm="giac")

[Out]

sage0*x

Mupad [F(-1)]

Timed out. \[ \int (a+a \sec (e+f x))^{3/2} (c-c \sec (e+f x)) \, dx=\int {\left (a+\frac {a}{\cos \left (e+f\,x\right )}\right )}^{3/2}\,\left (c-\frac {c}{\cos \left (e+f\,x\right )}\right ) \,d x \]

[In]

int((a + a/cos(e + f*x))^(3/2)*(c - c/cos(e + f*x)),x)

[Out]

int((a + a/cos(e + f*x))^(3/2)*(c - c/cos(e + f*x)), x)